package org.pageley.games.domain.environment;

import org.pageley.games.domain.Direction;
import org.pageley.games.domain.Location;
import org.pageley.games.domain.SimpleLocation;

public class SimpleNode implements Node {

	private Location location;
	
	public SimpleNode(Location location) {
		this.location = location;
	}
	
	public SimpleNode(int x, int y) {
		this(new SimpleLocation(x, y));
	}

	@Override
	public double distanceTo(Node node) {
		return this.location.distanceTo(node.getLocation());
	}

	@Override
	public Location getLocation() {
		return this.location;
	}

	@Override
	public String toString() {
		return "Node @ " + this.location;
	}

	@Override
	public boolean canTravelFrom(Direction outbound) {
		return true;
	}

	@Override
	public boolean canTravelTo(Direction inbound) {
		return true;
	}

}
